Comparing changes
Open a pull request
base repository: eggert/tz
base: 2022f
head repository: eggert/tz
compare: 2022g
Commits on Oct 28, 2022
-
Copy the full SHA e5a7161View commit details -
Copy the full SHA 5600d65View commit details -
Fix tzalloc bug on platforms lacking tm_zone
Problem reported by Đoàn Trần Công Danh in: https://mm.icann.org/pipermail/tz/2022-October/032153.html * NEWS: Mention this. * zdump.c (tzalloc) [!USE_LOCALTIME_RZ && HAVE_SETENV]: Return a nonnull pointer.
Copy the full SHA a91830bView commit details -
Port struct tm guessing to musl
Prompted by report from Đoàn Trần Công Danh in: https://mm.icann.org/pipermail/tz/2022-October/032153.html * private.h (TM_GMTOFF, TM_ZONE): By default, assume they work on musl, which #defines __tm_zone.
Copy the full SHA dbe87feView commit details -
Copy the full SHA f4c0967View commit details -
Don’t dump core if argv[0] is NULL, which is allowed on GNU/Linux if the invoker is sufficiently perverse. * zdump.c (progname): Now char const *, so that it can be given the address of a string constant. (tzalloc): Use optarg, not progname, since progname’s type is no longer correct. * zdump.c, zic.c (main): Initialize progname to non-null.
Copy the full SHA b037132View commit details
Commits on Oct 29, 2022
-
Update Mexico zone table comments
Problem reported by Chris Walton in: https://mm.icann.org/pipermail/tz/2022-October/032157.html * zone.tab, zone1970.tab: Don’t mention time zone names in the comments for Mexican entries, as they were obsolete for Chihuahua and Ojinaga and were not that helpful anyway in a location-based selection. Reorder based on location more than timezone rules.
Copy the full SHA 9f1f40cView commit details -
Update Mexico comments some more
* northamerica: Update comments to match latest law. Reorder entries (no change to actual data) to make the comments clearer. * zone.tab, zone1970.tab: Reorder to put special case of Bahía de Banderas after the more-general case of America/Mazatlan, and mention in comment that the latter covers only most of Nayarit, not all of it.
Copy the full SHA 359a7aeView commit details -
Fix GET_RANDOM default on macOS
Problem reported by Gilmore Davidson in: https://mm.icann.org/pipermail/tz/2022-October/032168.html * Makefile, NEWS: Mention this and clarify doc. * private.h (HAVE_GETRANDOM): Move to ... * zic.c: ... here since it’s needed only in zic.c. Don’t default to true on platforms like macOS that have sys/random.h but not GRND_RANDOM.
Copy the full SHA 5db8b3bView commit details -
Copy the full SHA 0e1616eView commit details -
Make it easier to skip backcheck
Inspired by a suggestion from Stephen Colebourne in: https://mm.icann.org/pipermail/tz/2022-October/032170.html * Makefile (check_back, check_mild): New rules, split out from existing ones, so that one can use ‘make check_mild’ instead of ‘make check’ to skip the backcheck. * NEWS: Mention this.
Copy the full SHA 2a18b74View commit details -
Pacify compilers re #undef HAVE_GETRANDOM
* zic.c (HAVE_GETRANDOM): Do not rely on this macro evaluating to zero if undefined in an #if. Although the C standard guarantees this, some compilers warn about it.
Copy the full SHA 8411832View commit details
Commits on Oct 30, 2022
-
Require explicit -DHAVE_GETTEXT on macOS
Problem reported by Gilmore Davidson in: https://mm.icann.org/pipermail/tz/2022-October/032168.html * private.h (HAVE_GETTEXT): On macOS, require an explicit -DHAVE_GETTEXT to use gettext.
Copy the full SHA 71958ddView commit details
Commits on Oct 31, 2022
-
Port better to old Linux kernels
Problem reported by Igor Ivanov in: https://mm.icann.org/pipermail/tz/2022-October/032192.html * NEWS: Mention this. * zic.c (get_rand_u64): Don’t use clock_gettime; it’s too much of a configuration hassle.
Copy the full SHA 317cc2cView commit details -
Revert change re default HAVE_GETTEXT on macOS
* Makefile: Add commentary about this. * private.h (HAVE_GETTEXT): Revert previous change in this area.
Copy the full SHA 377e311View commit details
Commits on Nov 1, 2022
-
Work around MS-Windows nmake bug
Work around an nmake incompatibility with POSIX. Problem reported by Manuela Friedrich in: https://mm.icann.org/pipermail/tz/2022-October/032126.html * Makefile (check_sorted): Don’t use ‘^$$/’, which causes MS-Windows nmake to report a syntax error and exit due to its nonstandard treatment of ‘^$’ to mean ‘$$’, which means the following ‘$/’ is a syntax error. Don’t bother to replace other instances of ‘^$’; they are harmless unless you run ‘make check’ which wouldn’t work on native MS-Windows anyway.
Copy the full SHA ee3ddc6View commit details -
Copy the full SHA b4253bbView commit details
Commits on Nov 4, 2022
-
Allocate at least one slot even if unused, so malloc(0) is never called, as it can return NULL even on success in AIX. Problem reported by Tim McBrayer in: https://mm.icann.org/pipermail/tz/2022-November/032210.html This bug was introduced the Qt bug 53071 workaround was removed, as the workaround allocated one more slot than needed. * zic.c (writezone): Don’t malloc(0).
Copy the full SHA f104933View commit details -
Suggested by Guy Harris in: https://mm.icann.org/pipermail/tz/2022-November/032213.html * zic.c (estrdup): Rename form ecpyalloc. All uses changed. The old name dates back to 1986, before strdup was standardized.
Copy the full SHA 4a69a06View commit details -
Fix unlikely conversion bug in zic
* zic.c (puttzcode): Arg is zic_t, not int_fast32_t. This fixes a portability bug on platforms where int_fast32_t is a 32-bit ones’ complement or signed-magnitude integer, and where the argument is -2**31 before conversion to int_fast32_t. Although I don’t know of any such platforms, the C standard allows them.
Copy the full SHA f4808eeView commit details
Commits on Nov 6, 2022
-
Fix some pre-1996 timestamps in northern Canada
(Problems reported by Chris Walton.) * NEWS: Mention this. * backward (America/Pangnirtung): New backward-compatibility link. * backzone (America/Pangnirtung): Move here from northamerica, except omit the dubious line saying it observed AST. * northamerica (NT_YK): Move 1965 transitions ... (Yukon): ... to this new Rule. (America/Pangnirtung): Move to 'backzone'. (America/Whitehorse, America/Dawson): Use new Rule for 1965. (America/Whitehorse): Transiton from -09 to -08 was 1966-02-27, not 1967-05-28. * zone.tab, zone1970.tab (America/Pangnirtung): Remove.
Copy the full SHA 45ee615View commit details -
Copy the full SHA 3609abfView commit details -
Copy the full SHA 9c01173View commit details -
Generate nicer 'make check' output
* Makefile (DIFF_TZS): New macro. (check_tzs, $(TIME_T_ALTERNATIVES)): Use it.
Copy the full SHA bc4e7f0View commit details
Commits on Nov 8, 2022
-
Port mktime and strftime to strict C
Problem reported by Robert Elz in: https://mm.icann.org/pipermail/tz/2022-November/032236.html * NEWS: Mention this. * localtime.c (time2sub): * strftime.c (_fmt): When preparing to call mktime, copy only the struct tm components that mktime needs. This avoids accessing components that may be uninitialized.
Copy the full SHA 6c713aeView commit details
Commits on Nov 10, 2022
-
Copy the full SHA 40c12e6View commit details -
Support timegm by default, as per C23
Also, fix a bug in timegm; it sometimes modified its input even on failure. * Makefile, NEWS: Mention this. * localtime.c (mktmcpy): New static function. (time2sub): Use it. (timegm, timeoff): Define even if !STD_INSPIRED. (timeoff): Make it static if !STD_INSPIRED. (timegm): Do not modify *TMP on failure, even if only to change TMP->is_isdst. * private.h (HAVE_DECL_TIMEGM): Specify reasonable default value. (timegm): Always declare one way or another.
Copy the full SHA dd0ed4eView commit details
Commits on Nov 11, 2022
-
Copy the full SHA aaca8faView commit details
Commits on Nov 12, 2022
-
Colombia’s 1993 fallback was 02-06 24:00
(Thanks to Alois Treindl.) * NEWS: Mention this. * southamerica (CO): Change 1993 fallback to Feb 6 24:00.
Copy the full SHA bc2942eView commit details
Commits on Nov 18, 2022
-
Change TF spelling in iso3166.tab
* iso3166.tab: Change TF spelling from “French Southern & Antarctic Lands” to “French Southern Territories" to reflect current ISO 3166. I guess the ISO 3166 spelling changed some time between 1996 and now, (perhaps to reflect the idea that TF no longer extends into Antarctica?) and we never noticed.
Copy the full SHA 1d1aa38View commit details
Commits on Nov 19, 2022
-
Copy the full SHA f4ca780View commit details -
* private.h (HAVE_GENERIC, LLONG_MAX, LLONG_MIN): Don’t define if compiled with gcc -std=c89 -pedantic, since that GCC diagnoses _Generic and long long. (ULLONG_MAX): Define if not already defined, and if __LONG_LONG_MAX__ and !__STRICT_ANSI__. (uint_fast64_t, uintmax_t, PRIuMAX): Rely on ULLONG_MAX, not __LONG_LONG_MAX__.
Copy the full SHA 85a4b4aView commit details -
Port UINT_FAST64_MAX back to C89
The recent patch “Improve randomness of zic temp file names” used UINT_FAST64_MAX, which assumes C99. * private.h (UINT_FAST64_MAX): Define if not already defined. Reorganize the fallback a bit, to prefer long to long long if either will do.
Copy the full SHA 8b1c6abView commit details -
Port int_fast64_t to C89 64-bit long
* private.h (int_fast64_t, INT_FAST64_MIN, INT_FAST64_MAX) (PRIdFAST64): Prefer long to long long if either will do, as that works better on C89 platforms with 64-bit long.
Copy the full SHA b5a8115View commit details -
Copy the full SHA 43faca9View commit details -
Simplify inputline return value
* zic.c (inputline): Return bool, not ptrdiff_t. All callers changed.
Copy the full SHA cc82913View commit details -
* localtime.c (time2sub): Refactor to do subtraction at compile-time rather than addition at runtime. Use yourtm.tm_year instead of y; they’re equal, and using yourtm.tm_year simplifies later patches.
Copy the full SHA 1f15b7cView commit details -
Refactor zic to simplify overflow checking
* zic.c (size_product): Return ptrdiff_t not size_t. The result fits in both types, as any sizes greater than PTRDIFF_MAX will cause problems elsewhere; and signed types are better in debugging implementations that check signed integer overflow. (align_to, growalloc): Refactor to simplify future transition to ckd_add. (grow_nitems_alloc): New static function, to simplify this refactoring.
Copy the full SHA 8e303beView commit details -
Refactor zic overflow checking
* zic.c (oadd, tadd): Negate sense of branch, to simplify future changes. (tadd): Simplify.
Copy the full SHA ad10807View commit details -
Avoid some size_t values in localtime.c
* localtime.c (tzloadbody): No need to give a name to strlen(name). (tzparse): Prefer ptrdiff_t to size_t where either will do.
Copy the full SHA c49f087View commit details -
Don’t assume INT_MAX < UINT_FAST64_MAX
* zic.c (get_rand_u64): Avoid undefined behavior in getrandom fallback, on theoretical platforms where UINT_FAST64_MAX <= INT_MAX so a * b can have signed integer overflow even though A and B are uint_fast64_t.
Copy the full SHA 1d7ab56View commit details -
Fix size_t overflow check if SIZE_MAX == INT_MAX
* zdump.c (sumsize): * zic.c (align_to): Avoid undefined behavior if SIZE_MAX == INT_MAX and adding two sizes overflows.
Copy the full SHA f55f17aView commit details -
* NEWS: Mention this. * date.c (dogmt, timeout): Limit allocations to at most PTRDIFF_MAX bytes to avoid undefined behavior on pointer subtraction. (dogmt): Work even if ‘environ’ has more than INT_MAX entries. (timeout): Avoid unnecessary pointer test, as the caller does this. Avoid unnecessary copy of struct tm. Don’t infloop on size_t overflow. Double size of array if it’s too small, to avoid O(N**2) CPU. * private.h (PTRDIFF_MAX): Move default value here ... * zic.c: ... from here, since date.c now uses it.
Copy the full SHA 50a2551View commit details -
Improve integer overflow checking in zdump
* zdump.c (size_overflow): New function. (sumsize): Use it. (sumsize, tzalloc): Don’t allow sizes greater than PTRDIFF_MAX, as they’re trouble on many platforms. (tzalloc, saveabbr, main, hunt, format_local_time) (format_utc_offset, format_quoted_string, istrftime, showtrans): Prefer ptrdiff_t to size_t where either will do, as we can get better runtime overflow checking with signed types. (istrftime): Check for size overflow when adding 2 (!).
Copy the full SHA dcc6bcfView commit details -
Fix theoretical integer overflow in zic.c
* zic.c (FORMAT_LEN_GROWTH_BOUND): New constant. (infile): Don’t allocate a local buffer so large that later size calculations can overflow. (getsave, inzsub, doabbr, stringzone): Prefer ptrdiff_t to size_t where either will do, as signed overflow is easier for a debugging implementation to check.
Copy the full SHA 2d933eaView commit details -
Fix another theoretical zic.c overflow
* zic.c (size_overflow, size_sum): New functions. (size_product, align_to, growalloc, relname): Prefer ptrdiff_t to size_t where either will do. (random_dirent, relname): Check for unlikely integer overflow.
Copy the full SHA 8288955View commit details -
Prefer <stdckdint.h> for overflow checking
If <stdckdint.h> is available, or if its macros can be implemented easily, use the macros for overflow checking. This should help avoid future integer overflow bugs. * date.c (dogmt, timeout): * localtime.c (localsub, timesub, increment_overflow) (increment_overflow32, increment_overflow_time, time2sub): * zdump.c (sumsize, tzalloc): * zic.c (size_sum, size_product, grow_nitems_alloc, oadd, tadd): Prefer ckd_add etc. to doing overflow checking by hand. * private.h (HAVE_STDCKDINT_H): Default to true if __has_include(<stdckdint.h>). Include <stdckdint.h> if available. (ckd_add, ckd_sub, ckd_mul): Provide substitutes on recent-enough GCC-compatible compilers.
Copy the full SHA 57b8fc9View commit details
Commits on Nov 20, 2022
-
Use C23 [[maybe_unused]] if available
* Makefile (GCC_DEBUG_FLAGS): Omit -Wno-unused-parameters, as the code is now safe for gcc -Wunused-parameters. * private.h (ATTRIBUTE_MAYBE_UNUSED): New macro. * localtime.c (gmtsub): * strftime.c (strftime_l) [HAVE_STRFTIME_L]: * zdump.c (gmtoff): Use it to mark possibly-unused parameters. * zdump.c (hunt): * zic.c (getleapdatetime): Omit unused arg. All callers changed.
Copy the full SHA 53b3f12View commit details
Commits on Nov 21, 2022
-
Omit unnecessary double-underscores
This follows up on a comment by Russ Allbery in: https://mm.icann.org/pipermail/tz/2022-November/032310.html * private.h (ATTRIBUTE_MALLOC, ATTRIBUTE_PURE) (ATTRIBUTE_FORMAT, ATTRIBUTE_MAYBE_UNUSED, _Noreturn): Omit double underscores around attributes. They aren’t needed, since private.h is not a public include file so we don’t need to worry about includers #defining ‘pure’ etc.
Copy the full SHA 15c01afView commit details -
Use C23 [[noreturn]] if available
* private.h (ATTRIBUTE_NORETURN): Rename from _Noreturn, which C23 says is obsolescent, and use C23-style [[noreturn]] if available. All uses of _Noreturn changed.
Copy the full SHA dbfcefeView commit details
There are no files selected for viewing
Large diffs are not rendered by default.